<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>{$website['name']|default=''|htmlentities} – {$site.name|htmlentities}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="{$website['keywords']|htmlentities}">
    <meta name="description" content="{$website['description']|htmlentities}">
    <link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
    <link href="/assets/css/frontend.css" rel="stylesheet">
    <link href="/assets/css/common.css" rel="stylesheet">
    <script type="text/javascript">
        var require = {
            config: JSON.parse('{$config|json_encode}')
        };
    </script>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="__CDN__/assets/js/html5shiv.js"></script>
    <script src="__CDN__/assets/js/respond.min.js"></script>
    <![endif]-->
    <style>
        .city-picker-span.focus, .city-picker-span.open,.city-picker-span {
            border-color: #ccc !important;
        }
    .btn{padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid #fc8939;
    color: #fc8939;
    background: #fff; float: right;}
    </style>
</head>
<body>
    <div id="app">
        <div id="loading" ref="loadNode">
            <div id="loading-center">
                <div id="loading-center-absolute">
                    <div class="object" id="object_four"></div>
                    <div class="object" id="object_three"></div>
                    <div class="object" id="object_two"></div>
                    <div class="object" id="object_one"></div>
                </div>
            </div>
        </div>
        <header class="header">
            <div class="header-container">
                <div class="header-left">
                    <div class="header-logo" @click="handle('/',false)">
                        <img src="__CDN__/assets/img/logo.png" alt="Logo" class="header-logo">
                        <span class="header-title">{$site.name|htmlentities}</span>
                    </div>
                    <nav class="header-nav">
                        <a href="javascript:;" @click="handle(item.url,item.is_login)" :class="item.url =='/special'?`nav-item active`:`nav-item`" v-for="(item,index) in head">{{item.name}}</a>
                    </nav>
                </div>
                <div class="header-right"  v-if="user">
                    <i class="fa fa-list-alt header-icon" @click="handle('/notice',false)"></i>
                    <div class="user-info" data-toggle="dropdown">
                        <img :src="user.avatar || '__CDN__/assets/img/avatar.png'" class="user-avatar">
                        <span class="user-name">{{ user.nickname }}</span>
                    </div>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header" @click="handle('/user/info')">
                            <img :src="user.avatar" class="img-circle" alt="">
                            <p>
                                <div>{{ user.nickname }}</div>
                                <small>闻道ID:{{user.id}}</small>
                            </p>
                        </li>
                        <li class="user-body">
                            <div class="user-list" @click="handle('/user/info')">
                                <div>我的资料</div>
                                <i class="fa fa-chevron-right"></i>
                            </div>
                            <div  class="user-list" @click="handle('/user/favorites')">
                                <div>我的收藏</div>
                                <i class="fa fa-chevron-right"></i>
                            </div>
                            <div class="user-list" @click="handle('/user/adviser')">
                                <div>我的实战</div>
                                <i class="fa fa-chevron-right"></i>
                            </div>
                        </li>
                        <li class="user-body">
                            <div class="user-list" @click="handle('/user/list')">
                                <div>榜单明细</div>
                                <i class="fa fa-chevron-right"></i>
                            </div>
                        </li>
                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div>
                                <a href="/user/logout"><i class="fa fa-sign-out"></i>
                                    {:__('Logout')}</a>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="header-right" v-else   @click="handle('/',false)">
                    <i class="fa fa-list-alt header-icon" ></i>
                    <div class="user-info">
                        <i class="fa fa-user-circle fa-fw header-icon" style="margin-right: 5px;"></i>
                        <span class="user-name">登录</span>
                    </div>
                </div>
                
            </div>
        </header>
        <section class="banner">
            <div class="search-container">
                <div class="search-categories">
                    <a href="javascript:;" class="search-category" @click="handle('/',false)">全部</a>
                    <a href="javascript:;" class="search-category"  @click="handle('/wfgroup',true)">闻风楼</a>
                    <a href="javascript:;" class="search-category"  @click="handle('/wpgroup',true)">三十六计</a>
                    <a href="javascript:;" class="search-category"  @click="handle('/adviser',true)">谋士</a>
                    <a href="javascript:;" class="search-category"  @click="handle('/resource',true)">资源库</a>
                </div>
                <div class="search-box">
                    <input type="text" class="search-input" placeholder="搜索..." v-model="searchQuery" @input="handleSearch" @keydown="handleKeyDown">
                    <button class="search-button" @click="submitSearch"><i class="fa fa-search"></i></button>
                    <div class="search-suggestions" v-if="suggestions.length && showSuggestions" style="z-index: 1000000;">
                        <div class="suggestion-item" v-for="(item, index) in suggestions" :key="index" @click="selectSuggestion(item)">
                            <div class="suggestion-title" v-html="item.text"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="headerCarousel" class="carousel slide" data-ride="carousel" data-interval="2500" data-pause="hover">
                <!-- 指示器 -->
                <ol class="carousel-indicators">
                    <template v-for="(item,bi) in banner" :key="bi">
                        <li :data-target="'#headerCarousel'" :data-slide-to="bi" :class="{active: bi === 0}"></li>
                    </template>
                </ol>
            
                <!-- 轮播图片 -->
                <div class="carousel-inner">
                    <div :class="index==0?`item active`:`item`" v-for="(item,index) in banner"  @click="handle(item.url,item.is_login)">
                        <img :src="item.image" :alt="item.title">
                    </div>
                </div>
            
                <!-- 左右切换按钮 -->
                <a class="left carousel-control" href="#headerCarousel" data-slide="prev">
                    
                </a>
                <a class="right carousel-control" href="#headerCarousel" data-slide="next">
                    
                </a>
            </div>
        </section>
        <section class="container">
            <div class="row">
                <div class="col-md-9 col-xs-12">
                    <div class="content">
                        <div class="content-top">
                            <div class="sidebar-header" style="padding:0 15px;">
                                <span style="color:#5dd459;font-size: 14px;">可报名</span>
                            </div>
                            <div class="content-silder">
                                <div class="content-nav">
                                    <div class="silder-tit">聚会类型:</div>
                                    <div :class="typeItem == 0?`nav-items active`:`nav-items`" @click ="handleType('0')">全部</div>
                                    <div :class="typeItem == item.id?`nav-items active`:`nav-items`" @click ="handleType(item.id)" v-for="(item,index) in typelist">{{item.name}}</div>
                                </div>
                                <div id="searchShow" @click="handleShow"></div>
                            </div>
                            <div style="width:150px; padding:0 10px;  display: flex; position: relative;">
                                <input readonly value="全国" name="city" data-toggle='city-picker'>
                            </div>
                        </div>
                        <div class="content-list" v-if="list.length >0">
                            <div class="content-citem" style="padding:10px; border:1px solid #f1f1f1;" v-for="(item,index) in list" @click="handle('/special/detail?id='+item.id,true)">
                                <div class="citem-left">
                                    <img :src="item.image?item.image:'/assets/img/logo.png'">
                                </div>
                                <div class="citem-right">
                                    <div class="citem-title" style="align-items: center;">
                                        <div style="flex:1;">{{item.title}}</div>
                                        <div style="width:60px;"><span style="padding:4px 8px; font-size: 12px;background-color: #5dd459;color:#fff;">报名中</span></div>
                                    </div>
                                    <div class="citem-descript">
                                        <span style="color:#fc8939;font-size: 14px; font-weight: bold; margin-right: 5px;">{{item.type_name}}</span> | <span style="font-size: 14px;color:#666;margin: 0 5px;">{{item.start_time}}</span> | <span style="font-size: 14px;color:#666;margin: 0 5px;">{{item.times}} 人局</span>
                                        <button class="btn" @click ="handle('/special/detail?id='+item.id,true)">查看详情</button>
                                    </div>
                                    <div class="citem-footer">
                                        <div style="display: flex;">
                                            <img :src="item.user.avatar" width="25px" height="25px" style="border-radius: 50%; margin-right: 5px;">
                                            {{item.user.nickname}}
                                        </div>
                                        <div class="citem-time">报名人数:{{item.nums}}/{{item.times}}</div>
                                    </div>    
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="col-md-3 hidden-xs">
                    <div class="sidebar-header" style="flex-direction: column;">
                        <div style="flex:row;align-items: center; margin-top: 10px; font-size: 13px;">
                            <i class="fa fa-list-alt"></i>
                            <span style="font-size: 13px;margin-left: 5px;">已发布场精彩活动</span>
                        </div>
                    </div>
                    
                    <div class="sidebar-edit">
                        <div class="edit-border" @click="handleAdd()">
                            <div style="border:1px dashed #eee;padding:30px;color:#d1d1d1;">
                                <i class="fa fa-plus" ></i>
                            </div>
                            <div class="btn btn-edit">发布</div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
</body>
<script src="/assets/js/require.js" data-main="/assets/js/require-frontend.js?v={$site.version|htmlentities}"></script>
</html>
